Get Country Group
Get country group based on its name.
Method: POST
{{URL}}/cardv2
Headers
| Name | Value | 
|---|---|
| Content-Type | application/json | 
Example
Request Parameters
| Parameters | Description | 
|---|---|
reference Optional  | String Unique reference ID of the request Sample Value: "visadps100040"  | 
transactionType Mandatory  | String Type of operation / transaction Constant Value : "GET_COUNTRYGROUP"  | 
customerId Mandatory  | String Unique ID of the customer Sample Value : "100000000006001"  | 
product Mandatory  | String Name of the product associated with the card Sample Value: "DEFAULT"  | 
channel Mandatory  | Enum Processing channel through which the card transaction happens Valid Values: PULSE VISA_DPS Sample Value :"VISA_DPS"  | 
program Mandatory  | String Name of the program to which the card product is mapped Sample Value : "DEFAULT"  | 
countryGroup Mandatory  | Object  | 
groupName Mandatory  | String Name of the country group Sample Value : "Mathew Whitelist Group 001"  | 
- cURL
 - C#
 - Go
 - NodeJs
 
curl --location --globoff '{{URL}}/cardv2' \
--header 'Content-Type: application/json' \
--data '{"method":"ledger.CARD.request","id":"1","params":{"payload":{"reference":"visadps100040","transactionType":"GET_COUNTRYGROUP","customerId":"100000000006001","product":"DEFAULT","channel":"VISA_DPS","program":"DEFAULT","countryGroup":{"groupName":"Mathew Whitelist Group 001"}},"api":{"signature":"{{signature}}","apiKey":"{{Api-key}}","credential":"{{cred}}"}}}'
var options = new RestClientOptions("{{URL}}/cardv2")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@"    ""method"": ""ledger.CARD.request"",
" + "\n" +
@"    ""id"": ""1"",
" + "\n" +
@"    ""params"": {
" + "\n" +
@"        ""payload"": {
" + "\n" +
@"            ""reference"": ""visadps100040"",
" + "\n" +
@"            ""transactionType"": ""GET_COUNTRYGROUP"",
" + "\n" +
@"            ""customerId"": ""100000000006001"",
" + "\n" +
@"            ""product"": ""DEFAULT"",
" + "\n" +
@"            ""channel"": ""VISA_DPS"",
" + "\n" +
@"            ""program"": ""DEFAULT"",
" + "\n" +
@"            ""countryGroup"": {
" + "\n" +
@"                ""groupName"": ""Mathew Whitelist Group 001""
" + "\n" +
@"            }
" + "\n" +
@"        },
" + "\n" +
@"        ""api"": {
" + "\n" +
@"            ""signature"": ""{{signature}}"",
" + "\n" +
@"            ""apiKey"": ""{{Api-key}}"",
" + "\n" +
@"            ""credential"": ""{{cred}}""
" + "\n" +
@"        }
" + "\n" +
@"    }
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
  "fmt"
  "strings"
  "net/http"
  "io"
)
func main() {
  url := "{{URL}}/cardv2"
  method := "POST"
  payload := strings.NewReader(`{`+"
"+`
    "method": "ledger.CARD.request",`+"
"+`
    "id": "1",`+"
"+`
    "params": {`+"
"+`
        "payload": {`+"
"+`
            "reference": "visadps100040",`+"
"+`
            "transactionType": "GET_COUNTRYGROUP",`+"
"+`
            "customerId": "100000000006001",`+"
"+`
            "product": "DEFAULT",`+"
"+`
            "channel": "VISA_DPS",`+"
"+`
            "program": "DEFAULT",`+"
"+`
            "countryGroup": {`+"
"+`
                "groupName": "Mathew Whitelist Group 001"`+"
"+`
            }`+"
"+`
        },`+"
"+`
        "api": {`+"
"+`
            "signature": "{{signature}}",`+"
"+`
            "apiKey": "{{Api-key}}",`+"
"+`
            "credential": "{{cred}}"`+"
"+`
        }`+"
"+`
    }`+"
"+`
}`)
  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
  'method': 'POST',
  'hostname': '{{URL}}',
  'path': '/cardv2',
  'headers': {
    'Content-Type': 'application/json'
  },
  'maxRedirects': 20
};
var req = https.request(options, function (res) {
  var chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
  res.on("error", function (error) {
    console.error(error);
  });
});
var postData = JSON.stringify({
  "method": "ledger.CARD.request",
  "id": "1",
  "params": {
    "payload": {
      "reference": "visadps100040",
      "transactionType": "GET_COUNTRYGROUP",
      "customerId": "100000000006001",
      "product": "DEFAULT",
      "channel": "VISA_DPS",
      "program": "DEFAULT",
      "countryGroup": {
        "groupName": "Mathew Whitelist Group 001"
      }
    },
    "api": {
      "signature": "{{signature}}",
      "apiKey": "{{Api-key}}",
      "credential": "{{cred}}"
    }
  }
});
req.write(postData);
req.end();
Body
{
    "method": "ledger.CARD.request",
    "id": "1",
    "params": {
        "payload": {
            "reference": "visadps100040",
            "transactionType": "GET_COUNTRYGROUP",
            "customerId": "100000000006001",
            "product": "DEFAULT",
            "channel": "VISA_DPS",
            "program": "DEFAULT",
            "countryGroup": {
                "groupName": "Mathew Whitelist Group 001"
            }
        },
        "api": {
            "signature": "{{signature}}",
            "apiKey": "{{Api-key}}",
            "credential": "{{cred}}"
        }
    }
}
Response: 200
Response Parameters
| Parameters | Description | 
|---|---|
Id  | String Response Id echoed from the request Id Sample Value : "1"  | 
result  | Object  | 
countryGroup  | Object  | 
id  | String Unique identifier of the country group Sample Value : "673d99a236e456cc9c792c14"  | 
groupName  | String Name of the country group Sample Value : "Mathew Whitelist Group 001"  | 
description  | String Description of the country group Sample Value : "MA Whitelist Group"  | 
countryCodes  | Array An array of country codes included in the group Sample Value : "US"  | 
active  | Boolean Indicates whether the country group is active Sample Value : true  | 
createdDate  | String Date and time when the country group was created Sample Value : "2024-11-20T08:11:14.682Z"  | 
updatedDate  | String Date and time when the country group was last updated Sample Value : "2024-11-20T08:12:40.338Z"  | 
isCreatedBridge  | Boolean Indicates whether the country group was validated via the bridge service Sample Value : false  | 
api  | Object  | 
type  | String Acknowledgement for type of operation requested for Constant value: " GET_COUNTRYGROUP_ACK"  | 
reference  | String Auto generated reference ID of this acknowledgment Sample value: " REFvisadps100040"  | 
dateCreated  | Number Unix timestamp of the response was created Sample value: 1732090492  | 
originalReference  | String Original reference ID taken from the request Sample value: " visadps100040"  | 
{
   "id": "1",
   "result": {
       "countryGroup": {
           "id": "673d99a236e456cc9c792c14",
           "groupName": "Mathew Whitelist Group 001",
           "description": "MA Whitelist Group",
           "countryCodes": [
               "NZ",
               "US"
           ],
           "active": true,
           "createdDate": "2024-11-20T08:11:14.682Z",
           "updatedDate": "2024-11-20T08:12:40.338Z",
           "isCreatedBridge": false
       },
       "api": {
           "type": "GET_COUNTRYGROUP_ACK",
           "reference": "REFvisadps100040",
           "dateCreated": 1732090492,
           "originalReference": "visadps100040"
       }
   }
}